﻿using System.ComponentModel;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace DeepEarth.Toolkit.Controls.Automation
{
    public class AutomationView : INotifyPropertyChanged
    {
        ObservableCollection<Waypoint> waypoints;

        public ObservableCollection<Waypoint> Waypoints
        {
            get { return waypoints; }
            set
            {
                waypoints = value;
                OnPropertyChanged("Waypoints");
            }
        }

        AutomationState state = AutomationState.Watch;

        public AutomationState State
        {
            get
            {
                return state;
            }
            set
            {
                if (state != value)
                {
                    state = value;

                    OnPropertyChanged("State");
                }
            }
        }

        bool loop = true;
        public bool Loop
        {
            get { return loop; }
            set 
            {
                if (loop != value)
                {
                    loop = value;
                    OnPropertyChanged("Loop");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
